function getTimestamp(timestamp) {
  let str = timestamp + "";

  if (str) {
    if (str.length) {
      if (str.length === 13) {
        return str;
      } else if (str.length < 13) {
        let n = 13 - str.length;

        for (let i = 0; i < n; i++) {
          str += "0";
        }

        return parseInt(str);
      }
    }
  }

  return new Date().getTime();
}

export default getTimestamp;
